import request from '@/utils/request'
// import qs from 'qs'
export function commodityList(params) {
  return request({
    url: '/operate/proInfos/queryProInfo',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get',
    data: params,
    params: {
        pageNum: params.pageNum,
        pageSize: params.pageSize,
        proCode: params.proCode,
        goodsBrand: params.goodsBrand,
        // pageConvert: params.pageConvert
        infoName: params.infoName,
        catId:params.catId,
        status:params.status
    }
  })
}
/**
 * 查询商品分类
 */
export function getSearchList() {
  return request({
    url: '/operate/proInfos/findClassifyByName',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}
export function update(params) {
  return request({
    url: '/operate/proInfos/updateStatusBySoldOut',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'put',
    data:params
  })
}
export function change(params) {
  return request({
    url: '/operate/proInfos/updateStatusByPutaway',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'put',
    data:params
  })
}
export function getManufacturerList() {
  return request({
    url: '/operate/proInfos/findsupplierByName',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}

export function addIngfoList(data) {
  return request({
    url: '/operate/proInfos/saveproInfo',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}
export function addImg(data) {
  return request({
    url: '/ids/pub/file/uploadFile',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    method: 'post',
    data
  })
}
export function updateInformation(data) {
  return request({
    url: '/operate/proInfos/updateProInfo',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'put',
    data
  })
}
export function echoedformation(proId) {
  return request({
    url: '/operate/proInfos/queryProPericeByProId/'+proId,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'get',
  })
}
//查询分类
export function queryManufacturer(catId) {
  return request({
    url: '/operate/proInfos/findClassifyByNames/'+catId,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}
//查询厂家
export function queryFactory(supplierId) {
  return request({
    url: '/operate/proInfos/findsupplierByNames/'+supplierId,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}
//查询商品信息
export function queryTitle(proId) {
  return request({
    url: '/operate/proParams/queryParam/'+proId,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}
//查询购买条件

export function queryCondition(proId) {
  return request({
    url: '/operate/proInfos/queryProPrice/'+proId,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}
//查询购买条件中的标签内容

export function queryProLableList(proId) {
  return request({
    url: '/operate/proInfos/queryProLableList/'+proId,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}
//尾货标签
export function queryTag(id) {
  return request({
    url: '/operate/proInfos/tag/'+id+'?tags=4',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}
//查商品规格
export function standardsTags(proId) {
  return request({
    url: '/operate/proInfos/queryProPrice/'+proId,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}
//尾货价钱
export function standardsPrice(data) {
  return request({
    url: '/operate/proInfos/updateProPrice',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}